package org.example.project3.Mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.project3.Entity.Acontents;

@Mapper
public interface AcontentsMapper {
    @Insert("insert into acontents (article_id,contents) values (#{articleId},#{contents})")
    void insert(Acontents acontents);

    @Delete("delete from acontents where article_id = #{id}")
    void delete(Integer id);

    @Select("SELECT contents FROM acontents where article_id = #{id}")
    String getByid(Integer id);

    void edit(Acontents acontents);
}
